#include "Income.h"
using namespace std;

// @author A0088381W
Income::Income (string name, double amount): Entry ( name, amount) {
}

// @author A0088381W
Income::Income (string name, double amount, time_t timeOfRecord, time_t timeOfInput, string remark): Entry ( name, amount, timeOfInput) {
	_timeOfRecord = timeOfRecord;
	_remark = remark;
}

//@author U095387X
Income::Income (string name, string objectString, string remark) {

	_name = name;

	istringstream instr(objectString);

	instr >> _amount >> _timeOfRecord >> _timeOfInput;

	_remark = remark;

}

//@author A0088381W
time_t Income::getTimeOfRecord() {
	return _timeOfRecord;
}

//@author A0088381W
string Income::getRemark() {
	return _remark;
}

//@author U095387X
string Income::serialize() {
	ostringstream outstr;

	outstr << _name << endl;
	outstr << _amount << " " << _timeOfRecord << " " << _timeOfInput << endl;
	outstr << _remark;

	return outstr.str();
}